# coding: utf-8
from application import db


class User(db.Model):
    __tablename__ = 'user'

    id = db.Column(db.Integer, primary_key=True, info='主键')
    nickname = db.Column(db.String(30, 'utf8mb4_bin'), info='昵称')
    login_name = db.Column(db.String(20, 'utf8mb4_bin'), unique=True, info='登录用户名')
    login_pwd = db.Column(db.String(32, 'utf8mb4_bin'), info='登陆密码')
    login_salt = db.Column(db.String(32, 'utf8mb4_bin'), info='登录加密随机码')
    status = db.Column(db.Integer, server_default=db.FetchedValue(), info='状态0：无效，1：有效')
    updated_time = db.Column(db.DateTime, server_default=db.FetchedValue(), info='更新时间')
    created_time = db.Column(db.DateTime, server_default=db.FetchedValue(), info="插入时间")
